DATASET_CFG = dict(
    train = dict(
        type='vspw',
        set='train',
        rootdir='/data/yixiang/Dataset/VSPW_480p',
        aug_opts=[
            ('Resize', {'output_size': (720, 480), 'keep_ratio': True, 'scale_range': (0.5, 2.0)}),
                     ('RandomCrop', {'crop_size': (512, 512), 'one_category_max_ratio': 0.75}),
                     ('RandomFlip', {'flip_prob': 0.5}),
                     ('PhotoMetricDistortion', {}),
                     ('Normalize', {'mean': [123.675, 116.28, 103.53], 'std': [58.395, 57.12, 57.375]}),
                     ('ToTensor', {}),
                     ('Padding', {'output_size': (512, 512), 'data_type': 'tensor'})
        ],
        clip_num=4,
        dilation="3,6,9",
        random_select=False,
        sequence_range=0,
    )
)
DATALOADER_CFG = dict(
    train = dict(
        type = ['nondistributed', 'distributed'][1],
        batch_size = 8,
        num_workers = 4,
        shuffle = True,
        pin_memory = True,
        drop_last = True,
    )
)
MODEL_CFG = dict(
    type = 'clip_psp',
    num_classes = 150,
    benchmark = True,
    is_multi_gpus = False,
    align_corners = False,
    psp_weight = False,
    deep_sup_scale = 0.4,
    distributed = dict(
        is_on = True, 
        backend = 'nccl'),
    norm_cfg = dict(
        type ='syncbatchnorm', 
        opts = {}),
    act_cfg = dict(
        type = 'relu',
        opts = dict(inplace=True)),
    backbone = dict( 
        type = 'swin_base_patch4_window12_384_22k',
        series = 'swin',
        pretrained = True,
        selected_indices = (0, 1, 2, 3),
        pretrained_model_path = '/home/lja/pretrain/swin_base_patch4_window12_384_22k.pth',
        norm_cfg = {'type': 'layernorm', 'opts': {}},
    ),
    ppm = dict(
        in_channels = 2048,
        out_channels = 150,
        pool_scales = [1, 2, 3, 6],
    ),
)
OPTIMIZER_CFG = dict(
    type = 'adamw',
    adamw = dict(
        learning_rate = 0.00003,
        betas = (0.9, 0.999),
        weight_decay = 0.01,
        min_lr = 0.0,
    ),
    max_epochs = 130,
    params_rules = dict(backbone_net_zerowd = (1.0, 0.0), 
    others = (1.0, 1.0)),
    policy = dict(
        type = 'poly',
        opts = dict(power = 1.0, 
            max_iters = None, 
            num_iters = None, 
            num_epochs = None),
        warmup = dict(type = 'linear', 
        ratio = 1e-6, 
        iters = 1500)
    ),
    adjust_period = ['iteration', 'epoch'][0],
)
INFERENCE_CFG = dict(
    mode = 'whole',
    opts = {}, 
    tricks = dict(
        multiscale = [1],
        flip = False,
        use_probs_before_resize = False
    )
)
COMMON_CFG = dict(
    train = dict(
        backupdir = '/data/lja/vspw_swin_base_train',
        logfilepath = '/data/lja/vspw_swin_base_train/train.log',
        loginterval = 10,
        saveinterval = 1
    ),
    test = dict(
        backupdir = '/data/lja/vspw_swin_base_test',
        logfilepath = '/data/lja/vspw_swin_base_test/test.log',
        resultsavepath = '/data/lja/vspw_swin_base_test/vspw_swin_base_results.pkl'
    )
)
